/*
 * File: bitband.h
 * cortex-m bit band defines
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-08-04     LinuxLife    the first version
 * 2025-10-24     LinuxLife    change __IO to volatile
 *                             rename include defines
 */
#ifndef __BITBAND_H__
#define __BITBAND_H__




#define MEM_WR(ADDRESS) *((volatile unsigned long *)ADDRESS)


#define BITBAND(ADDRESS, BIT) \
		MEM_WR( \
			( \
				(ADDRESS & 0xF0000000) + 0x2000000 + \
				((ADDRESS & 0xFFFFF) << 5) + \
				(BIT << 2) \
			) \
		)


#endif